export const getToken = (name) => {
  const data = localStorage.getItem(name)
  try {
    return JSON.parse(data)
  } catch (error) {
    return data
  }
}

export const setToken = (name, value) => {
  if (typeof value === 'object') {
    localStorage.setItem(name, JSON.stringify(value))
  }
}

export const removeItem = (name) => {
  localStorage.removeItem(name)
}
